<?php
$this->breadcrumbs=array(
	'社区',
);

$this->menu=array(
	array('label'=>'发布主题', 'url'=>array('/topic/create')),
);

$this->manual=array(
		array('label'=>'如何创建内容', 'url'=>array('index')),
		array('label'=>'如何创建故事', 'url'=>array('create')),
		array('label'=>'如何添加链接', 'url'=>array('update')),
		array('label'=>'如何加入工作室', 'url'=>array('changepwd')),
		array('label'=>'如何查看积分', 'url'=>'#'),
		array('label'=>'如何参与社区', 'url'=>array('admin')),
);

?>
<div>
	<span style = "background: #EEE; padding: 5px; color: #FFF; border: 1px #CCC solid;">
		<?php 
			echo CHtml::link('发布主题', array('/topic/create'));
		?>
	</span>
</div>
<div class = "span-12" >

	<div style = "background:#F9F9F9; padding:7px; border:1px #c0d3e0 solid; margin-top:10px; height:300px;">
		<h4>社区公告</h4>
		<hr>
		<?php
			foreach ($topicNotice as $value){
				echo CHtml::link($value->title,array('/topic/view', 'id'=>$value->id));
				echo "<span style = 'float:right'>".date("m-d",$value->create_time)."</span>";
				echo "<br>";
			}
		?>
	</div>
	
	<div style = "background:#F9F9F9; padding:7px; border:1px #c0d3e0 solid; margin-top:10px; height:300px;">
		<h4 style = "float:left">创意风暴</h4>
		<span style = "float:right";><?php echo CHtml::link('更多>>',array('/topic/more')); ?></span>
		<hr>
		<?php
			foreach ($topicIdea as $value){
				echo CHtml::link($value->title,array('/topic/view', 'id'=>$value->id));
				echo "<br>";
			}
		?>
	</div>
	
	<div style = "background:#F9F9F9; padding:7px; border:1px #c0d3e0 solid; margin-top:10px; height:300px;">
		<h4>社区事务</h4>
		<hr>
		<?php
			foreach($topicWork as $value){
		    	echo CHtml::link($value->title, array('/topic/view', 'id'=>$value->id));
		        echo "<br>";
		    } 
		?>
		</div>

</div>

<div class = "span-8 last" >
	<div style = "background:#F9F9F9; padding:7px; border:1px #c0d3e0 solid; margin-top:10px; height:300px;">
		<h4 style = "float:left;">成熟度投票</h4>
		<span style = "float:right;"><?php echo CHtml::link('更多>>',array('/topic/more')); ?></span>
		<hr>
		<?php
			foreach ($pollNew as $value){
				echo CHtml::link($value->node->title, array('/community/viewpoll', 'id'=>$value->id, 'tid'=>$value->tid));
				echo "<span style = 'float: right'>".date('m-d',$value->start_time);
				echo "至";
				echo date('m-d',$value->finish_time);
				echo "</span><br />";
			}
		?>
	</div>
	
	<div style = "background:#F9F9F9; padding:7px; border:1px #c0d3e0 solid; margin-top:10px; height:300px;">
		<h4>最新创建</h4>
		<hr>
		<?php
			foreach ($nodeNew as $value){
				echo CHtml::link($value->title, array('/node/view', 'id'=>$value->id));
				echo "<br>";
			}
		?>
	</div>
	
	<div style = "background:#F9F9F9; padding:7px; border:1px #c0d3e0 solid; margin-top:10px; height:300px;">
		<h4>等待撰写</h4>
		<hr>
		<?php
			foreach ($nodeEmpty as $value){
				echo CHtml::link($value->title, array('/node/view', 'id'=>$value->id));
				echo "<br>";
			}
		?>
	</div>
</div>

<div class = "span-20" style = "margin-top: 10px;">
		<div style = "background:#F9F9F9; padding:10px; border:1px #c0d3e0 solid; ">
			<h4>最新内容的讨论</h4>
			<hr>
			<?php
				foreach($nodeTalkNew as $value){
					echo "About:".CHtml::link($value->node->title, array('/node/view', 'id'=>$value->nid));
					echo " ";
			    	echo "Talk:".CHtml::link(mb_substr($value->talk, 0, 36, "UTF8"), array('/nodetalk', 'id'=>$value->nid));
			    	if (mb_strlen($value->talk, "utf-8") > 36){
			    		echo "…";
			    	}
			  
			        echo "<br>";
			    } 
			?>
		</div>
</div>